#ifndef XVTREEVIEW_H
#define XVTREEVIEW_H

#include "DataView_global.h"
#include <QTreeView>

#include "projectmodel.h"
#include "taskattrmodel.h"
#include "attrmodel.h"
#include "xvdelegate.h"

namespace xvs {

//class ProjectModel;

/**
 * @brief The XVEditorTreeView class
 */
class DATAVIEW_EXPORT XVProjectTreeView : public QTreeView
{
    Q_OBJECT
public:
    XVProjectTreeView();
    ~XVProjectTreeView();

    ProjectModel* ViewModel();

    //void SetStyle(int style);

private slots:
    void slot_MenuRequested(const QPoint& pos);

//    void slot_editorWidget();
//    void slot_addNewItem();

private:
    ProjectModel* mModel;

    //EditorDelegate* mDelegate;
};


/**
 * @brief The XVEditorTreeView class    设定任务
 */
class DATAVIEW_EXPORT XVEditorTreeView : public QTreeView
{
    Q_OBJECT
public:
    XVEditorTreeView();
    ~XVEditorTreeView();

    TaskAttrModel* ViewModel();

    //void SetStyle(int style);

private slots:
    void slot_MenuRequested(const QPoint& pos);

    void slot_editorWidget();

    void slot_setExtendStruct();

private:
    TaskAttrModel* mModel;

    EditorDelegate* mDelegate;
};


/**
 * @brief The ValueEditorTreeView class 指令的属性值 编辑
 */
class DATAVIEW_EXPORT ValueEditorTreeView : public QTreeView
{
    Q_OBJECT
public:
    ValueEditorTreeView();
    ~ValueEditorTreeView();

    AttrModel *ViewModel();

    void SetInstObj(InstObj* instobj);

    //void SetStyle(int style);

private slots:
    void slot_MenuRequested(const QPoint& pos);

    void slot_addNewItem();

private:
    AttrModel* mModel;

    ValueEditorDelegate* mDelegate;

    InstObj* mInstObj = nullptr;
};




}

#endif // XVTREEVIEW_H
